﻿@using MvcPaging
@model MvcApplication5.Models.IndexModel

@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link rel="stylesheet" type="text/css" href="/css/style.css"
    media ="all" />
    <link rel="stylesheet" type="text/css" href="/css/style.css" media ="all" />
    <link href="/CSS/styleSlide.css" rel="stylesheet" />
    <link href="/CSS/ddlevelsmenu-base.css" rel="stylesheet" />
    <link href="/CSS/ddlevelsmenu-topbar.css" rel="stylesheet" />
    <link href="/CSS/ddlevelsmenu-sidebar.css" rel="stylesheet" />
    <script src="/CSS/ddlevelsmenu.js"></script>
    <script src="/CSS/jquerySlide.js"></script>
</head>

<body>
<div class="main">
	<div class="header">
        <div id="wowslider-container1">
	        <div class="ws_images">
                <ul>     
                    <li><img src="../../CSS/Images/banner.jpg" id="wows1_0" /></li>
                    <li><img src="../../CSS/Images/banner2.jpg" id="wows1_1"/></li>
                    <li><img src="../../CSS/Images/banner3.jpg" id="wows1_2" /></li>
                    <li><img src="../../CSS/Images/banner3.jpg" id="wows1_3" /></li>
                </ul>
            </div>
	    </div>
        <script src="../../Scripts/wowslider.js"></script>
        <script src="../../Scripts/scriptSlide.js"></script>
    </div> <!--End header-->
    <div class="header-footer"></div>
    <div class="menu">
    	<ul>            
        	<li class="menu-sub"><a href="/NewsSite" class="menu-sub-text">Trang chủ</a></li>
            @foreach (var item in Model.Categories.Where(c => c.Tag.Length < 5)){
                    <li class="menu-sub"><a href="/NewsSite/Category/@item.CategoryId" class="menu-sub-text">@item.Name</a></li>                                            
            }                            
        </ul>
    </div> <!--End menu-->
    
    <div class="body">
    	<div class="body-left">
           <div class="body-left-topic01">
           		<div class="body-left-topic-header01">
                    <div class="tag-title">
                       Kết quả cho từ khóa: @ViewBag.searchString
                    </div>
           		</div>                
               @foreach(var item in Model.News){
                   var Author = item.Author != null ? item.Author.Name : "";
               <div class="category-newslist">
                    <div class="category-newslist-image">
                        <a><img src="/CSS/images/@item.Image" style="width:200px; height:180px"/></a>
                    </div>
                    <div class="category-newslist-content">
                        <h2>@item.Title</h2>
                        <p>Tác giả: @Author | @item.PublishedDate | Chuyên mục: <a href="/NewsSite/Category/@item.CategoryId" class="category-newslist-category">@item.Category.Name</a></p>
                        <p class="category-newslist-summary">@item.Summary</p>
                    </div>
               </div>
               }
               <div class="paging-box">
                    <p class="pager">@Html.Pager(Model.News.PageSize, Model.News.PageNumber, Model.News.TotalItemCount).Options(o => o.AddRouteValue("searchString",ViewBag.searchString))</p>                                   
                </div>
           </div> <!--End body-left-topic01-->                              
        </div> <!--End body-left-->
        <div class="body-right">
            <div class="body-right-header">
                @using(Html.BeginForm("Search","NewsSite")){
                    <input type="text" class="body-right-searchbar" name="searchString"/>
                    <input type="submit" class="body-right-searchbutton" value="Tìm kiếm"/>
                }
            </div>            
            <div class="body-right-content2">
                <div class="body-right-header">
                    <h3 class="body-right-title">Xem nhiều nhất</h3>
                </div>
                <div class="body-right-content2-scroll">                                                
                <table class="body-left-topic-content03-right-table">                            
                            @foreach (var item in Model.MostViewed) {                                                                
                                    <tr>
                                        <td><a href="/NewsSite/Details/@item.NewsId"><img src="/css/images/@item.Image" width="90"; height="55";></a></td>
                                        <td><a href="/NewsSite/Details/@item.NewsId" style="text-decoration:none">@item.Title</a></td>
                                    </tr>                                
                            }                           
                </table>
                </div>
            </div>
            <div class="body-right-content">                
                <div class="body-right-header">
                    <h3 class="body-right-title">Bình luận mới</h3>
                </div>
                @foreach (var item in Model.Comments)
                {                    
                    <div class="body-right-content-comment">
                        <span class="body-right-content-conmment-text1">@item.Name</span>
                        <span class="body-right-content-conmment-text2"><a>@item.Content</a></span>
                        <div class="body-right-content-comment-article"><a href="/NewsSite/Details/@item.News.NewsId" style="text-decoration:none">->  @item.News.Title</a></div>
                    </div>                    
                }
            </div>
        </div> <!--End body-right-->
    </div> <!--End body-->
    
</div> <!--End main-->
</body>
</html>
